package com.cskaoyan.util;

import org.apache.commons.mail.DefaultAuthenticator;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;

public class EmailUtils {
    public static void send(String msg,String sendTo) throws EmailException {
        SimpleEmail email = new SimpleEmail();
        email.setHostName("smtp.exmail.qq.com");
        email.setSmtpPort(465);
        email.setAuthenticator(new DefaultAuthenticator("java38xueyufan@whdlmxxjsyxgs.wecom.work","Wangdao123"));
        email.setSSLOnConnect(true);
        email.setCharset("UTF-8");
        email.setSubject("cskaoyanMarket");
        email.setFrom("java38xueyufan@whdlmxxjsyxgs.wecom.work");
        email.setMsg(msg);
        email.addTo(sendTo);
        email.send();
    }
}
